package com.mhy.exam.mapper;

import com.mhy.exam.pojo.Order;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface OrderMapper {
    Integer insert(Order order);


    @Insert("INSERT INTO tb_order values (null, #{payment}, #{paymentType}, #{status})")
    void insert0(Order order);

    @Delete("DELETE FROM tb_order WHERE id = #{id}")
    void delete(Integer id);

    @Update("UPDATE tb_order SET payment = #{payment},payment_type = #{paymentType}, status = #{status} WHERE id = #{id}")
    void update(Order order);

    @Select("SELECT * FROM tb_order WHERE id = #{id}")
    Order select(Integer id);
}
